package jmine.tec.services.impl;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum ServicesImplMessages implements MessageCreator {
    INPUT_UNKNOWN_CELL_TYPE(1, "services.input.unknownCellType"),

    INPUT_ERRORS_FOUND(0, "services.input.errorsFound"),

    SERVICE_NOT_IMPLEMENTED(2, "services.serviceNotImplemented"),

    INPUT_CELL_FORMULA_CONTAINS_ERROR(1, "services.input.cellFormulaContainsError"),

    UNEXPECTED_OBJECT_TYPE(2, "services.unexpectedObjectType"),

    DATABASE_PACK_CONFLICTING_ENTITY_TYPE(3, "jmine.tec.database.pack.conflicting.entity.type"),

    SERVICE_ASSERT_FAILED(3, "jmine.tec.service.assertFailed"),

    DRIVER_ERROR_READING_WORKBOOK(0, "services.driver.errorReadingWorkbook"),

    DATABASE_EXECUTAR_CYPHEREDCOMMAND_COMANDO_ENCRIPTADO_INVALIDO(0,
            "jmine.tec.database.services.executar.cypheredcommand.comando.encriptado.invalido"),

    GENERIC_EXECUTION_ERROR(1, "services.genericServicesExecutionError"),

    SERVICE_NOT_IMPLEMENTED_FOR_CLASS(1, "services.serviceNotImplementedForClass"),

    DATABASE_PACK_IO_EXCEPTION(0, "jmine.tec.database.pack.io.exception"),

    GENERIC_SERVICE_EXECUTION_ERROR(2, "services.genericServiceExecutionError"),

    ERROR_CLOSING_CONNECTION(0, "services.errorClosingConnection"),

    CANNOT_CHANGE_SERVICE_FOR_CLASS(3, "services.cannotChangeServiceForClass"),

    SERVICE_ASSERT_FAILED_ABOVE_TOLERANCE(4, "jmine.tec.service.assertFailedAboveTolerance"),

    INPUT_ERROR_EXECUTING_FORMULA(1, "services.input.errorExecutingFormula"),

    SERVICE_FILLER_COULD_NOT_BE_INSTANTIATED(1, "services.serviceFillerCouldNotBeInstantiated"),

    DATABASE_EXECUTAR_CYPHEREDCOMMAND_COMANDO_DECRIPTADO_NAO_COINCIDE_COM_TEXTO_PLANO(0,
            "jmine.tec.database.services.executar.cypheredcommand.comando.decriptado.nao.coincide.com.texto.plano"),

    INVALID_SERVICES(0, "services.invalidServices"),

    INPUT_ERROR_READING_FILE(1, "services.input.errorReadingFile"),

    CLASS_NOT_FOUND_ERROR(1, "services.classNotFoundError"),

    DATABASE_EXECUTAR_CYPHEREDCOMMAND_NUMERO_LINHAS_ATUALIZADAS_NAO_ESPERADO(2,
            "jmine.tec.database.services.executar.cypheredcommand.numero.linhas.atualizadas.nao.esperado"),

    UNSUPPORTED_TRANSACTION_PROPAGATION(2, "services.unsupportedTransactionPropagation"),

    ASSERT_NUMBER_FAILED_PREFIX(4, "jmine.tec.services.assert.number.failed.prefix"),

    ASSERT_VALUE_FAILED_PREFIX(3, "jmine.tec.services.assert.value.failed.prefix"),

    ASSERT_NOT_SAME_FAILED_PREFIX(3, "jmine.tec.services.assert.not.same.failed.prefix"),

    ASSERT_SAME_FAILED_PREFIX(3, "jmine.tec.services.assert.same.failed.prefix"),

    ASSERT_NULL_FAILED_PREFIX(2, "jmine.tec.services.assert.null.failed.prefix"),

    ASSERT_NOT_NULL_FAILED_PREFIX(2, "jmine.tec.services.assert.not.null.failed.prefix"),

    ASSERT_NUMBER_FAILED(3, "jmine.tec.services.assert.number.failed"),

    ASSERT_VALUE_FAILED(2, "jmine.tec.services.assert.value.failed"),

    ASSERT_NOT_SAME_FAILED(2, "jmine.tec.services.assert.not.same.failed"),

    ASSERT_SAME_FAILED(2, "jmine.tec.services.assert.same.failed"),

    ASSERT_NULL_FAILED(1, "jmine.tec.services.assert.null.failed"),

    ASSERT_NOT_NULL_FAILED(1, "jmine.tec.services.assert.not.null.failed"),

    ASSERT_FAILED_NOT_INTERNATIONALIZED(1, "jmine.tec.services.assert.failed.not.internationalized"),

    ASSERT_FAILED_ERROR_EXPECTED(0, "jmine.tec.services.assert.error.expected"),

    ERROR_PROCESSING_SERVICES(0, "services.error.processing.services"),

    ERROR_SERVICE_NOT_FOUND(3, "services.error.service.not.found"),

    ERROR_SERVICE_CREATION_ERROR(3, "services.error.service.creation.error"),

    XLS_CHARACTER_LIMIT_OVERFLOW(3, "bancosys.tec.services.input.driver.XLSServiceWriter.xls.character.limit.overflow"),

    REFDB_ENTRY_NOT_FOUND(1, "jmine.tec.services.impl.refdb.entry.not.found"),
    
    VALIDATION_NOT_ALL_FIELDS_WERE_VALIDATED(1, "jmine.tec.services.validation.notAllFieldsWereValidated");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private ServicesImplMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-services-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
